package com.gcgo.client;

import com.gcgo.service.UserService;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class ClientBootstrap {
    private static final String providerName = "UserService#sayHello#";
    private static final String NOW_TIME="yyyy-MM-dd HH:mm:ss";

    public static void main(String[] args) throws InterruptedException {
        RpcConsumer rpcConsumer = new RpcConsumer();
        UserService proxy = (UserService) rpcConsumer.createProxy(UserService.class, providerName);
//        while (true) {
//            Scanner sc = new Scanner(System.in);
//            System.out.println("====================");
//            System.out.println("请输入信息：");
//            String s = sc.nextLine();
//            System.out.println(proxy.sayHello(s));
//        }
        while (true){
            System.out.println("=========================");
            LocalDateTime time= LocalDateTime.now();
            DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
            String getTime = time.format(fmt).toString();
            System.out.println(proxy.sayHello("春节过去了"));
            Thread.sleep(3000);
        }
    }
}
